<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"  %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>预约列表</title>
    <base href="<%=basePath%>">
    <%@ include file="/main/main_css.jsp" %>
    <%@ include file="/main/main_js.jsp" %>
</head>
<body>
    <!--  -->
    <div class="all-wrapper">
        <div class="row com-header text-center">
            <span>鹰潭市行政服务中心</span>
        </div>
        <div class="row main-content time-table">
        	<div class="row" >
                <div class="time-count pull-right">
                   <span>剩余</span> <span id="time" class="text-red"></span> <span>秒</span>
                </div>
            </div>
		<div class="row">
                <h1>预约列表</h1>
        </div>
           <table class="table table-bordered time-table-com" style="border:1px solid #efefef;">
                <tbody>
           		 <tr>
                       <td class="x">预约受理号</td>
                       <td class="x">预约人姓名</td>
                       <td class="x">预约部门名称</td>
                       <td class="x">预约事项名称</td>
                       <td class="x">预约时间</td>
                       <td class="x" style="width: 50px">操作</td>
                   </tr>
                <c:if test="${appointmentList.size()>0 }">
            	<c:forEach var="MyAppointment" items="${appointmentList }">
                    <tr>
                        <td><font size="5px">${MyAppointment.getOrderNo() }</font></td>
                        <td><font size="5px">${MyAppointment.getRealName() }</font></td>
                        <td><font size="5px">${MyAppointment.getDeptName() }</font></td>
                        <td><font size="5px">${MyAppointment.getItemName() }</font></td>
                        <td><font size="5px">${MyAppointment.getOrderDate() }</font></td>
                        <td><a class="btn btn-primary btn-lg" href="/smartTerminal/getMyAppointmentById?order_no=${MyAppointment.getOrderNo() }">查看详情</a></td>
                    </tr>
            	</c:forEach>
           		</c:if>
                </tbody>
            </table>
            <!-- 分页 --> 
            <form id="pageForm" action="/smartTerminal/getMyAppointmentList" method="post">
            	<input type="hidden" id="currentpage" name="currentpage" value="${MyAppointment.getCurrentpage()}"/>
            	<input type="hidden" id="pagesize" name="pagesize" value="${MyAppointment.getPagesize()}"/>
            </form>
            
			<div class="row">
                <div class="col-md-24">
                    <div class="pull-right">
                    	<c:if test="${MyAppointment.getCurrentpage() >1 }">
                    		<%-- <a href="/smartTerminal/getMyAppointmentList?currentpage=${MyAppointment.getCurrentpage()-1 }&pagesize=${MyAppointment.getPagesize()}">上一页</a> --%>
                    		<button class="btn btn-lg btn-warning" onclick="nextPage(${MyAppointment.getCurrentpage()-1 })">上一页</button>
                    	</c:if>
	                   	<c:if test="${MyAppointment.getCurrentpage() <=1}">
	                   		<button class="btn btn-lg btn-warning">上一页</button>
	                   	</c:if>
                    <span class="txt-md">${MyAppointment.getCurrentpage() }/${MyAppointment.getCurrentRows() }</span>
                    	<c:if test="${MyAppointment.getCurrentpage()<MyAppointment.getCurrentRows() }">
                    		<%-- <a href="/smartTerminal/getMyAppointmentList?currentpage=${MyAppointment.getCurrentpage()+1 }&pagesize=${MyAppointment.getPagesize()}">下一页</a> --%>
                    		<button class="btn btn-lg btn-warning" onclick="nextPage(${MyAppointment.getCurrentpage()+1 })">下一页</button>
                    		
                    	</c:if>	
                    	<c:if test="${MyAppointment.getCurrentpage()>=MyAppointment.getCurrentRows() }">
                    		<button class="btn btn-lg btn-warning">下一页</button>
                    	</c:if>
                    </div>
                </div>
            </div>
        </div>
        </div>
        <div class="row footer">
            <a class="btn btn-success btn-lg" href="loginOut" role="button"><i class="fa fa-reply"></i>返回首页</a>
            <%-- <a class="btn btn-primary btn-lg" href="/smartTerminal/getuseroritem?itemId=${itemDataObj.getITEMID() }" role="button"><i class="fa fa-arrow-left"></i>在线申报</a>
            <a class="btn btn-primary btn-lg" href="/smartTerminal/getItemAppointmentTime?itemid=${itemDataObj.getITEMID() }&SITE_NO=${itemDataObj.getNORMACCEPTDEPART() }" role="button">预约<i class="fa fa-arrow-right"></i></a>
            <a class="btn btn-primary btn-lg hidden" href="" role="button">提交<i class="fa fa-hand-pointer-o"></i></a> --%>
        </div>
    </div>
    <form id="loginOut" action="loginOut"></form>
    <script type="text/javascript">
	  //加入倒计时
		var count =  119;
		function countdown(){
			$("#time").text(count);
			if(count > 0){
				window.setTimeout("countdown()",1000);
				count --;
			}else{
				$("#loginOut").submit();
			}
			
		}
		countdown();   
    	
	  	//分页
		function nextPage(currentPage){
			$("#currentpage").val(currentPage);
			$("#pageForm").submit();
		}
    </script>
    <script src="static/js/common.js" type="text/javascript"></script>
</body>
</html>